<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
    <style type="text/css">
        #header {
    background-color:#0f6674;
    color:white;
    text-align:center;
    padding:5px;
}
        table {
     border-collapse: collapse;
     margin: auto;
     text-align: center;
     width: 100%;
     font-family: Futura, Arial, sans-serif;
}
caption {
     font-size: larger;
    background-color: #0f6674;
     margin: 1em auto;
}
th,td {
     padding: .65em;
}
th {
     background: #fff000;
   border: 1px solid #777;
   color: #000;
}
td {
     border: 1px solid#777;
}
tbody tr:nth-child(odd) {
     background: #ccc;
}
        button {
  background: #2e466e;
  background-image: -webkit-linear-gradient(top, #2e466e, #415989);
  background-image: -moz-linear-gradient(top, #2e466e, #415989);
  background-image: -ms-linear-gradient(top, #2e466e, #415989);
  background-image: -o-linear-gradient(top, #2e466e, #415989);
  background-image: linear-gradient(to bottom, #2e466e, #415989);
  -webkit-border-radius: 17px;
  -moz-border-radius: 17px;
  border-radius: 17px;
  text-shadow: 0px 1px 0px #263666;
  -webkit-box-shadow: inset 0px 0px 15px 3px #23395e;
  -moz-box-shadow: inset 0px 0px 15px 3px #23395e;
  box-shadow: inset 0px 0px 15px 3px #23395e;
  font-family: Arial;
  color: #ffffff;
  font-size: 16px;
  padding: 8px 30px 8px 30px;
  border: solid #1f2f47 1px;
  text-decoration: none;
}

        button:hover {
  color: #ffffff;
  background: #415989;
  text-decoration: none;
}
    </style>
<script type="text/javascript">
    function button_onclick() {
        alert("生成签到课程二维码...");
    }
</script>
</head>
<body bgcolor="#f5f5dc">
<div id="header">
<h1>签到二维码生成系统</h1>
</div>
<form role="search" method="post" id="searchform" action="/qrmanage/">
      {% csrf_token %}
      <input type="search" name="course" placeholder="签到课程" required style="height: 30px" value="微波天线">
      <button type="submit">搜索</button>
	<table>
		<thead>
			<tr>
                <th>学生姓名</th>
                <th>签到时间</th>
                <th>签到状态</th>
                <th>课程名</th>
                <th>教师</th>
                <th>教室</th>
            </tr>
		</thead>
		<tbody id="info">
        {% for p in post_list %}
			<tr>
            <td>{{p.stu_info}}</td>
            <td>{{p.stu_sign_time}}</td>
            <td>{{p.stu_sign_status}}</td>
            <td>{{ p.course }}</td>
            <td>{{ p.teacher_info }}</td>
            <td>{{ p.classroom }}</td>
            </tr>
        {% endfor %}
		</tbody>
	</table>
</form>
<form action="/qrgenerate/" method="post">
    <input type="hidden" value="{{ course }}" name="course">
      {% csrf_token %}
      <input type="hidden" name="train" value="start_train">
      <button name="qrgenearte" type="submit" style="display: block;margin: 0 auto" >生成二维码</button>
</form>
<center><img src="{{ img }}" alt="{{ course2 }}" style="margin: auto" ></center>
</body>
</html>